﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShopOnline.DAL;

namespace ShopOnline.BLL
{
    public class PaperPrices : _PaperPrices
    {
        public static PaperPrices GetPrices(int paperID, int? qty)
        {
            PaperPrices p = new PaperPrices();
            p.Where.PaperID.Value = paperID;
            if (qty != null)
            {
                p.Where.Quantity.Value = qty;
                p.Where.Quantity.Operator = MyGeneration.dOOdads.WhereParameter.Operand.GreaterThanOrEqual;
            }
            p.Query.AddOrderBy(PaperPrices.ColumnNames.Quantity, MyGeneration.dOOdads.WhereParameter.Dir.ASC);
            p.Query.Load();
            return p;
        }
    }
}
